<?php

namespace App\Http\Controllers;

use App\Services\RuleMenuService;
use Illuminate\Http\JsonResponse;

/**
 * 权限控制器
 * Class RuleMenuController
 * @package App\Http\Controllers
 */
class RuleMenuController extends Controller
{
    public $ruleMenuService;

    public function __construct(RuleMenuService $ruleMenuService)
    {
        parent::__construct();
        $this->ruleMenuService = $ruleMenuService;
    }

    /**
     * 根据当前用户角色，获取树形权限菜单
     * @return JsonResponse
     */
    public function leftMenus()
    {
        $treeMenus = $this->ruleMenuService->leftMenus();

        return $this->success($treeMenus);
    }

}
